home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Development Tools & Languages / Dylan Related / Mindy-1.1 (sources only) / mindy-1.1 / interp / mindy.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-18  |  2.4 KB  |  97 lines  |  [TEXT/ttxt]

  1. /**********************************************************************\
  2. *
  3. *  Copyright (c) 1994  Carnegie Mellon University
  4. *  All rights reserved.
  5. *  
  6. *  Use and copying of this software and preparation of derivative
  7. *  works based on this software are permitted, including commercial
  8. *  use, provided that the following conditions are observed:
  9. *  
  10. *  1. This copyright notice must be retained in full on any copies
  11. *     and on appropriate parts of any derivative works.
  12. *  2. Documentation (paper or online) accompanying any system that
  13. *     incorporates this software, or any part of it, must acknowledge
  14. *     the contribution of the Gwydion Project at Carnegie Mellon
  15. *     University.
  16. *  
  17. *  This software is made available "as is".  Neither the authors nor
  18. *  Carnegie Mellon University make any warranty about the software,
  19. *  its performance, or its conformity to any specification.
  20. *  
  21. *  Bug reports, questions, comments, and suggestions should be sent by
  22. *  E-mail to the Internet address "gwydion-bugs@cs.cmu.edu".
  23. *
  24. ***********************************************************************
  25. *
  26. * $Header: mindy.h,v 1.4 94/07/26 18:30:01 hallgren Exp $
  27. *
  28. \**********************************************************************/
  29.  
  30. #include <stddef.h>
  31.  
  32. extern void *malloc(size_t bytes);
  33. extern void *realloc(void *ptr, size_t bytes);
  34. extern void free(void *ptr);
  35.  
  36. typedef struct _object *obj_t;
  37.  
  38. struct object {
  39.     obj_t class;
  40. };
  41.  
  42. #define obj_is_ptr(o) (((unsigned long)(o))&1)
  43. #define obj_ptr(type, o) ((type)(((unsigned long)(o))-1))
  44. #define ptr_obj(ptr) ((obj_t)(((unsigned long)(ptr))+1))
  45. #define obj_rawptr(o) ((void *)(o))
  46. #define rawptr_obj(p) ((obj_t)(p))
  47.  
  48. extern void lose(char *fmt, ...);
  49.  
  50. #define assert(cond) \
  51.     do { \
  52.     if (!(cond)) \
  53.         lose("assertion failed, line %d file %s", __LINE__, __FILE__); \
  54.     } while (0)
  55.  
  56. typedef int boolean;
  57. #define TRUE 1
  58. #define FALSE 0
  59.  
  60. #ifndef NULL
  61. #define NULL ((void*)0)
  62. #endif
  63.  
  64.  
  65. #ifdef sparc
  66. #define SLOW_LONGJMP 1
  67. #endif
  68.  
  69. #ifdef hppa
  70. #define SLOW_FUNCTION_POINTERS 1
  71. #endif
  72.  
  73.  
  74. #ifndef SLOW_LONGJMP
  75. #define SLOW_LONGJMP 0
  76. #endif
  77.  
  78. #ifndef SLOW_FUNCTION_POINTERS
  79. #define SLOW_FUNCTION_POINTERS 0
  80. #endif
  81.  
  82. #ifdef sparc
  83. extern int printf();
  84. extern int fprintf();
  85. extern int fputc();
  86. extern int fputs();
  87. extern int fclose();
  88. extern int fseek();
  89. extern int isatty();
  90. extern int fflush();
  91. extern int vfprintf();
  92. extern int _filbuf();
  93. extern int _flsbuf();
  94. extern int tolower();
  95. extern int fsync();
  96. #endif
  97.